package com.dmz.wxcp.wecom.wxbusiness.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.dmz.wxcp.vo.req.ProductReqVO;
import com.dmz.wxcp.vo.resp.PurchasingPriceRespVO;
import com.dmz.wxcp.wecom.wxbusiness.entity.PurchasingPrice;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface PurchasingPriceMapper extends BaseMapper<PurchasingPrice> {


    @Select("select product_num,product_name,width,material,price_in*percent as pricesale " +
            "from product join purchasing_price as pp on product.product_id=pp.product_id " +
            "where product.category_id=#{productReqVo.categoryId}")
    IPage<PurchasingPriceRespVO> getPriceDetailList(IPage<PurchasingPrice> productIPage, @Param("productReqVo") ProductReqVO productReqVo);

    List<Object> getmobilepriceListsByProcedure(@Param("productReqVO") ProductReqVO productReqVO);

}
